// 处理历史对话记录数据
export const handleHistoryData = (data: any) => {
  return data.map((item: any, index: number) => {
    const { fromSource, query, answer, message } = item;
    console.log('121313213', message ? JSON.parse(message) : '');

    if (fromSource === 'user') {
      return {
        // id: `msg_${index}`,
        message: {
          text: query,
          role: 'user',
        },
        status: 'success',
      };
    } else {
      return {
        // id: `msg_${index}`,
        message: answer,
        status: 'success',
      };
    }
  });
};
